package book;

import static org.junit.jupiter.api.Assertions.*;

import java.util.List;

import org.junit.jupiter.api.Test;

class BookDaoImplTest {

	BookDaoImpl bdi = new BookDaoImpl();
	
	@Test
	void testInsert() {
		bdi.insert(new Book(5,"三国演义2","罗贯中"));
		bdi.insert(new Book(6,"西游记2","吴承恩"));
		bdi.insert(new Book(7,"红楼梦2","曹雪芹"));
		bdi.insert(new Book(8,"水浒传2","施耐庵"));
	}

	@Test
	void testUpdate() {
		bdi.update(new Book(2,"三体","刘慈欣"));
	}

	@Test
	void testDelete() {
		bdi.delete(2);
	}

	@Test
	void testSelectById() {
		Book b = bdi.selectById(1);
		System.out.println(b);
	}

	@Test
	void testSelectAll() {
		List<Book> books = bdi.selectAll();
		books.forEach(System.out::println);
	}

}
